package com.fast.cms.model.article;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fast.base.db.model.Commnent;
import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "T_cms_NoticeInfo")
@DynamicInsert(true)
@DynamicUpdate(true)
public class NoticeInfo {
	
	// =========================head===================================
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	private int id = 0;
	private String uuid = "";// 唯一ID
	// =========================body======================
	private String title = "";// 信息标题
	private Date startTime;// 起始时间
	private Date endTime;// 结束时间
	private String showTypeId = "";// 展示类型：00系统内部展示
	private String showType;// 展示类型：00系统内部展示
	@Column(length = 5000)
	private String noticeTypeId = "";// 公告类型id
	private String noticeType = "";// 公告类型
	@Column(length = 5000000)
	private String noticeDetail = "";// 信息详情

	private int readCount = 0;// 阅读次数
	private int collectionTimes = 0;// 收藏次数

	// =========================信息审核字段================
	private int checkerId;// 审核人id
	private String checker = "";// 审核人

	@Commnent("编辑时间")
	@Temporal(TemporalType.DATE)
	@Column(name = "check_Date")
	private Date checkDate;// 审核日期
	private String checkMsg = "";// 分局审核内容
	private int checkStatus = 0;// 0为待审核,1为已审核确认,2为审核末通过

	// =========================foot===================================
	// 操作信息
	@Commnent("编辑人ID")
	@Column(name = "editor_id", length = 11)
	private int editorId = 0;// 编辑人Id
	@Commnent("编辑人")
	@Column(name = "editor_name", length = 32)
	private String editorName = "";// 编辑人
	@Commnent("编辑时间")
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "edit_time")
	private Date editTime;// 编辑时间
	@Commnent("创建人ID")
	@Column(name = "creater_id", length = 11)
	private int createrId = 0;// 编辑人Id
	@Commnent("创建人")
	@Column(name = "creater", length = 32)
	private String creater = "";// 编辑人
	@Commnent("创建时间")
	@Column(name = "create_time", length = 32)
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	@Commnent("删除标识")
	@Column(name = "delete_flag", length = 1)
	private int deleteFlag = 0;// 默认为不删除，1为删除

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getShowType() {
		return showType;
	}

	public void setShowType(String showType) {
		this.showType = showType;
	}

	public String getNoticeTypeId() {
		return noticeTypeId;
	}

	public void setNoticeTypeId(String noticeTypeId) {
		this.noticeTypeId = noticeTypeId;
	}

	public String getNoticeType() {
		return noticeType;
	}

	public void setNoticeType(String noticeType) {
		this.noticeType = noticeType;
	}

	public String getNoticeDetail() {
		return noticeDetail;
	}

	public void setNoticeDetail(String noticeDetail) {
		this.noticeDetail = noticeDetail;
	}

	public int getReadCount() {
		return readCount;
	}

	public void setReadCount(int readCount) {
		this.readCount = readCount;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	@Override
	public String toString() {
		return "NoticeInfo [id=" + id + ", uuid=" + uuid + ", title=" + title + ", startTime=" + startTime
				+ ", endTime=" + endTime + ", showType=" + showType + ", noticeTypeId=" + noticeTypeId + ", noticeType="
				+ noticeType + ", noticeDetail=" + noticeDetail + ", readCount=" + readCount + ", collectionTimes="
				+ collectionTimes + ", editorId=" + editorId + ", editorName=" + editorName + ", editTime=" + editTime
				+ ", createrId=" + createrId + ", creater=" + creater + ", createTime=" + createTime + ", deleteFlag="
				+ deleteFlag + "]";
	}

	public int getCollectionTimes() {
		return collectionTimes;
	}

	public void setCollectionTimes(int collectionTimes) {
		this.collectionTimes = collectionTimes;
	}

	public String getShowTypeId() {
		return showTypeId;
	}

	public void setShowTypeId(String showTypeId) {
		this.showTypeId = showTypeId;
	}

	public int getCheckerId() {
		return checkerId;
	}

	public void setCheckerId(int checkerId) {
		this.checkerId = checkerId;
	}

	public String getChecker() {
		return checker;
	}

	public void setChecker(String checker) {
		this.checker = checker;
	}

	@JsonFormat(pattern = "yyyy-MM-dd")
	public Date getCheckDate() {
		return checkDate;
	}

	public void setCheckDate(Date checkDate) {
		this.checkDate = checkDate;
	}

	public String getCheckMsg() {
		return checkMsg;
	}

	public void setCheckMsg(String checkMsg) {
		this.checkMsg = checkMsg;
	}

	public int getCheckStatus() {
		return checkStatus;
	}

	public void setCheckStatus(int checkStatus) {
		this.checkStatus = checkStatus;
	}
}
